/**
 * @ClassName ChatController.java
 * @Desc ToDo
 * @Author TimDong
 * @CreateTime: 2015年4月25日 下午3:47:23
 */
package com.omni.web.controllers;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.omni.dao.entry.Userbase;

/**
 * @ClassName ChatController.java
 * @Desc ToDo
 * @Author TimDong
 * @CreateTime: 2015年4月25日 下午3:47:23
 */
@Controller
@RequestMapping("/chat")
public class ChatController extends BaseController{
	
	@RequestMapping(value = "/index", method=RequestMethod.GET)
	public ModelAndView room() {
		
		if (!hasLogged())
			return new ModelAndView("redirect:/home/login");
		
		Userbase user = (Userbase) getSession().getAttribute(SESSION_KEY_USER);
		
		if (user == null)
			return new ModelAndView("redirect:/home/login");
		
		return new ModelAndView("chat/index", "user", user);
	}

}
